package com.newblog.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.newblog.mapper.ArticleMapper;

import com.newblog.mapper.UserMapper;
import com.newblog.model.ArticleInfo;

import com.newblog.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2023-12-11
 * Time:16:24
 * Text：
 */
@Service
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, ArticleInfo> implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;
    @Override
    public int delete(Integer aid,int userId) {
       return articleMapper.delete(aid,userId);
    }

    @Override
    public int update(ArticleInfo articleInfo) {
        return articleMapper.update(articleInfo);
    }

    @Override
    public int getDetail(Integer id) {
        return articleMapper.getDetailById(id);
    }

    @Override
    public int getinsert(Integer id) {
        return articleMapper.getinsert(id);
    }
    @Override
    public List<ArticleInfo> getListByPage(int paszie, int ofest){
        return articleMapper.getListByPage(paszie,ofest);
    }
    @Override
    public int getCount(){
        return articleMapper.getCount();
    }
}
